<div class="body">
<div class="order_search">
<p class="error_msg"><?=isset($message)? $message:'';?></p>

<form action="<?=site_url('admin990/orders/search')?>" method="get">
<label>ID:</label><input type="text" name="id" value=""><input type="submit" value="chercher">
</form>

<form action="<?=site_url('admin990/orders/search')?>" method="get">
<label>e-mail:</label><input type="text" name="email" value=""><input type="submit" value="chercher">
</form>


<hr>


<table cellpadding="6" cellspacing="1" style="width:100%" border="0" align="center">
<tr style="background: skyBlue;">
<td>ID</td>
<td>Numéro de commande</td>
<td>Détaille</td>
<td>Client</td>
<td>L'heure de commande</td>
<td>Réservation</td>
<td>Emporter | Livraison</td>
<td>Réduction</td> 
<td>Supplément</td> 
<td>Total</td> 


</tr>

<?php if(isset($orders)){ foreach ($orders as $o):?>
<tr>
<td><?=$o->id?></td>
<td><?=$o->order_num?></td>
<td><a href="<?=site_url('admin990/orders/detail').'/'.$o->order_time->format('d/m/Y').'/'.$o->id.'?per_page='.$this->uri->segment(3);?>">- voir -</a></td>
<td><?=$o->member->firstname?>&nbsp;<?=$o->member->lastname?></td>
<td><?=$o->order_time?></td>
<td class="msg"><?=$o->reservation?></td>
<td><?php if($o->takeaway_time !=NULL){ echo '<b>Emporter</b> '.$o->takeaway_time; }else{ echo '<b>Livraison</b> '.$o->delivery_time; }?></td>
<td><?=$o->discount*100?>&nbsp;%</td>
<td><?if($o->extra != NULL){?><?=$o->extra?> €<?php }else{?>-  -  -<?php }?></td>
<td><?=number_format($o->total*(1-$o->discount)+$o->extra,1,'.','')?>&nbsp;€</td>
</tr>

<?php endforeach; }else{ echo "<tr><td>Il n'y pas de commande...</td></tr>";}?>

</table>
<hr>
<?php if(isset($page_links)){echo $page_links;}?>
<a href="<?=site_url('admin990/orders')?>">Terminer</a>
</div>
</div>
